package com.zycfc.zsf.boot.web;

import com.zycfc.zsf.boot.exception.*;

public abstract class BaseController
{
    public static final int PAGENUM = 1;
    public static final int PAGESIZE_20 = 20;
    public static final int PAGESIZE_50 = 50;
    public static final int PAGESIZE_100 = 100;
    
    protected void badRequest() throws BaseException {
        throw new BadRequestException();
    }
    
    protected void badRequest(final String message) throws BaseException {
        throw new BadRequestException(message);
    }
    
    protected void forbidden() throws BaseException {
        throw new ForbiddenException();
    }
    
    protected void forbidden(final String message) throws BaseException {
        throw new ForbiddenException(message);
    }
    
    protected void notFound() throws BaseException {
        throw new NotFoundException();
    }
    
    protected void notFound(final String message) throws BaseException {
        throw new NotFoundException(message);
    }
    
    protected void notModified() throws BaseException {
        throw new NotModifiedException();
    }
    
    protected void notModified(final String message) throws BaseException {
        throw new NotModifiedException(message);
    }
    
    protected void error() throws BaseException {
        throw new SystemException();
    }
    
    protected void error(final String message) throws BaseException {
        throw new SystemException(message);
    }
    
    protected void unauthorized() throws BaseException {
        throw new UnauthorizedException();
    }
    
    protected void unauthorized(final String message) throws BaseException {
        throw new UnauthorizedException(message);
    }
}
